\(\int \frac {\cos (x)}{(a-a \sin ^2(x))^2} \, dx\) [277]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 22 \[ \int \frac {\cos (x)}{\left (a-a \sin ^2(x)\right )^2} \, dx=\frac {\text {arctanh}(\sin (x))}{2 a^2}+\frac {\sec (x) \tan (x)}{2 a^2} \]

[Out]

1/2*arctanh(sin(x))/a^2+1/2*sec(x)*tan(x)/a^2

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3254, 3853, 3855} \[ \int \frac {\cos (x)}{\left (a-a \sin ^2(x)\right )^2} \, dx=\frac {\text {arctanh}(\sin (x))}{2 a^2}+\frac {\tan (x) \sec (x)}{2 a^2} \]

[In]

Int[Cos[x]/(a - a*Sin[x]^2)^2,x]

[Out]

ArcTanh[Sin[x]]/(2*a^2) + (Sec[x]*Tan[x])/(2*a^2)

Rule 3254

Int[(u_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Dist[a^p, Int[ActivateTrig[u*cos[e + f*x
]^(2*p)], x], x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0] && IntegerQ[p]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \sec ^3(x) \, dx}{a^2} \\ & = \frac {\sec (x) \tan (x)}{2 a^2}+\frac {\int \sec (x) \, dx}{2 a^2} \\ & = \frac {\text {arctanh}(\sin (x))}{2 a^2}+\frac {\sec (x) \tan (x)}{2 a^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.91 \[ \int \frac {\cos (x)}{\left (a-a \sin ^2(x)\right )^2} \, dx=\frac {\frac {1}{2} \text {arctanh}(\sin (x))+\frac {1}{2} \sec (x) \tan (x)}{a^2} \]

[In]

Integrate[Cos[x]/(a - a*Sin[x]^2)^2,x]

[Out]

(ArcTanh[Sin[x]]/2 + (Sec[x]*Tan[x])/2)/a^2

Maple [A] (verified)

Time = 0.43 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.45

method result size
parallelrisch \(\frac {\sec \left (x \right ) \tan \left (x \right )-\ln \left (-\cot \left (x \right )+\csc \left (x \right )-1\right )+\ln \left (-\cot \left (x \right )+\csc \left (x \right )+1\right )}{2 a^{2}}\) \(32\)
derivativedivides \(\frac {-\frac {1}{4 \left (1+\sin \left (x \right )\right )}+\frac {\ln \left (1+\sin \left (x \right )\right )}{4}-\frac {1}{4 \left (\sin \left (x \right )-1\right )}-\frac {\ln \left (\sin \left (x \right )-1\right )}{4}}{a^{2}}\) \(36\)
default \(\frac {-\frac {1}{4 \left (1+\sin \left (x \right )\right )}+\frac {\ln \left (1+\sin \left (x \right )\right )}{4}-\frac {1}{4 \left (\sin \left (x \right )-1\right )}-\frac {\ln \left (\sin \left (x \right )-1\right )}{4}}{a^{2}}\) \(36\)
risch \(-\frac {i \left ({\mathrm e}^{3 i x}-{\mathrm e}^{i x}\right )}{\left ({\mathrm e}^{2 i x}+1\right )^{2} a^{2}}-\frac {\ln \left ({\mathrm e}^{i x}-i\right )}{2 a^{2}}+\frac {\ln \left ({\mathrm e}^{i x}+i\right )}{2 a^{2}}\) \(58\)
norman \(\frac {\frac {\tan ^{5}\left (\frac {x}{2}\right )}{a}+\frac {\tan ^{7}\left (\frac {x}{2}\right )}{a}-\frac {\tan \left (\frac {x}{2}\right )}{a}-\frac {\tan ^{3}\left (\frac {x}{2}\right )}{a}}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right ) a \left (\tan ^{2}\left (\frac {x}{2}\right )-1\right )^{3}}-\frac {\ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{2 a^{2}}+\frac {\ln \left (\tan \left (\frac {x}{2}\right )+1\right )}{2 a^{2}}\) \(91\)

[In]

int(cos(x)/(a-a*sin(x)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/2*(sec(x)*tan(x)-ln(-cot(x)+csc(x)-1)+ln(-cot(x)+csc(x)+1))/a^2

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 37 vs. \(2 (18) = 36\).

Time = 0.28 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.68 \[ \int \frac {\cos (x)}{\left (a-a \sin ^2(x)\right )^2} \, dx=\frac {\cos \left (x\right )^{2} \log \left (\sin \left (x\right ) + 1\right ) - \cos \left (x\right )^{2} \log \left (-\sin \left (x\right ) + 1\right ) + 2 \, \sin \left (x\right )}{4 \, a^{2} \cos \left (x\right )^{2}} \]

[In]

integrate(cos(x)/(a-a*sin(x)^2)^2,x, algorithm="fricas")

[Out]

1/4*(cos(x)^2*log(sin(x) + 1) - cos(x)^2*log(-sin(x) + 1) + 2*sin(x))/(a^2*cos(x)^2)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 117 vs. \(2 (20) = 40\).

Time = 0.33 (sec) , antiderivative size = 117, normalized size of antiderivative = 5.32 \[ \int \frac {\cos (x)}{\left (a-a \sin ^2(x)\right )^2} \, dx=- \frac {\log {\left (\sin {\left (x \right )} - 1 \right )} \sin ^{2}{\left (x \right )}}{4 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2}} + \frac {\log {\left (\sin {\left (x \right )} - 1 \right )}}{4 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2}} + \frac {\log {\left (\sin {\left (x \right )} + 1 \right )} \sin ^{2}{\left (x \right )}}{4 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2}} - \frac {\log {\left (\sin {\left (x \right )} + 1 \right )}}{4 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2}} - \frac {2 \sin {\left (x \right )}}{4 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2}} \]

[In]

integrate(cos(x)/(a-a*sin(x)**2)**2,x)

[Out]

-log(sin(x) - 1)*sin(x)**2/(4*a**2*sin(x)**2 - 4*a**2) + log(sin(x) - 1)/(4*a**2*sin(x)**2 - 4*a**2) + log(sin
(x) + 1)*sin(x)**2/(4*a**2*sin(x)**2 - 4*a**2) - log(sin(x) + 1)/(4*a**2*sin(x)**2 - 4*a**2) - 2*sin(x)/(4*a**
2*sin(x)**2 - 4*a**2)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 41 vs. \(2 (18) = 36\).

Time = 0.23 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.86 \[ \int \frac {\cos (x)}{\left (a-a \sin ^2(x)\right )^2} \, dx=-\frac {\sin \left (x\right )}{2 \, {\left (a^{2} \sin \left (x\right )^{2} - a^{2}\right )}} + \frac {\log \left (\sin \left (x\right ) + 1\right )}{4 \, a^{2}} - \frac {\log \left (\sin \left (x\right ) - 1\right )}{4 \, a^{2}} \]

[In]

integrate(cos(x)/(a-a*sin(x)^2)^2,x, algorithm="maxima")

[Out]

-1/2*sin(x)/(a^2*sin(x)^2 - a^2) + 1/4*log(sin(x) + 1)/a^2 - 1/4*log(sin(x) - 1)/a^2

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 38 vs. \(2 (18) = 36\).

Time = 0.32 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.73 \[ \int \frac {\cos (x)}{\left (a-a \sin ^2(x)\right )^2} \, dx=\frac {\log \left (\sin \left (x\right ) + 1\right )}{4 \, a^{2}} - \frac {\log \left (-\sin \left (x\right ) + 1\right )}{4 \, a^{2}} - \frac {\sin \left (x\right )}{2 \, {\left (\sin \left (x\right )^{2} - 1\right )} a^{2}} \]

[In]

integrate(cos(x)/(a-a*sin(x)^2)^2,x, algorithm="giac")

[Out]

1/4*log(sin(x) + 1)/a^2 - 1/4*log(-sin(x) + 1)/a^2 - 1/2*sin(x)/((sin(x)^2 - 1)*a^2)

Mupad [B] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.36 \[ \int \frac {\cos (x)}{\left (a-a \sin ^2(x)\right )^2} \, dx=\frac {\mathrm {atanh}\left (\sin \left (x\right )\right )}{2\,a^2}-\frac {\sin \left (x\right )}{2\,\left (a^2\,{\sin \left (x\right )}^2-a^2\right )} \]

[In]

int(cos(x)/(a - a*sin(x)^2)^2,x)

[Out]

atanh(sin(x))/(2*a^2) - sin(x)/(2*(a^2*sin(x)^2 - a^2))